<script setup>
import { ref } from 'vue';
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
import { useInformation } from '@/store/modules/index.ts'

// #ifdef APP-PLUS
const deviceInfo = ref(null)

const getDeviceInfo = () => {
  deviceInfo.value = {
    system: uni.getSystemInfoSync(),
    client: plus.device.getInfo(),
    uuid: plus.device.uuid
  }
  console.log('设备信息:', deviceInfo.value)
}
// #endif

onLaunch(() => {
  //#ifdef APP-PLUS
  getDeviceInfo()
  // #endif
  //#ifdef H5
  const user = useInformation()
  if (user.isExpired()) {
  	user.clearUser()
  } 
  // #endif
})  

onShow(() => {
  console.log('App Show')
})

onHide(() => {
  console.log('App Hide')
})
</script>

<style lang="scss">
	@import "@/uni_modules/vk-uview-ui/index.scss";
	
</style>